<?php echo $header; ?>
<div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
</div>
<div id="notification"></div>
<?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
    <h1><?php echo $heading_title; ?></h1>

    <div class="h1-bb"></div>
    <?php echo $text_message; ?>
    <!--<div class="buttons">
        <div class="right"><a href="<?php echo $continue; ?>" class="button"><?php echo $button_continue; ?></a></div>
    </div>-->
    <?php
if(isset($this->session->data['last_order_id'])){
        $this->load->model('account/order');
        $total_data = $this->model_account_order->getOrderTotals($this->session->data['last_order_id']);
        $product_name=$this->model_account_order->getOrderProducts($this->session->data['last_order_id']);

        $m_shop = 2541486;
        $m_orderid = $this->session->data['last_order_id'];
        $m_amount = number_format($total_data[0]['value'], 2, ".", "");
        $m_curr = $this->session->data['currency'];
        $m_desc = base64_encode(stripslashes(htmlspecialchars(strip_tags(('Оплата пакета «'.$product_name[0]['name'].'» на сумму '.$m_amount.' '.$m_curr)))));
        $m_key = 'M9cdLFP52J';

        $arHash = array(
            $m_shop,
            $m_orderid,
            $m_amount,
            $m_curr,
            $m_desc,
            $m_key
        );
        $sign = strtoupper(hash('sha256', implode(":", $arHash)));
    ?>
    <form method="GET" action="//payeer.com/api/merchant/m.php">
        <input type="hidden" name="m_shop" value="<?php echo $m_shop; ?>">
        <input type="hidden" name="m_orderid" value="<?php echo $m_orderid; ?>">
        <input type="hidden" name="m_amount" value="<?php echo number_format($m_amount, 2, ".", "") ?>">
        <input type="hidden" name="m_curr" value="<?php echo $m_curr;?>">
        <input type="hidden" name="m_desc" value="<?php echo $m_desc;?>">
        <input type="hidden" name="m_sign" value="<?php echo $sign; ?>">
        <div class="buttons">
            <div class="right"><input class="button" type="submit" name="m_process" value="Оплатить"/></div>
        </div>
    </form>

<?php } ?>
    <?php echo $content_bottom; ?></div>
<?php echo $footer; ?>
